package a.f.h.a.b;

import a.c.*;
import a.c.d;
import a.c.e;
import a.c.m;
import a.c.q;
import a.f.h.a.a.f;
import a.f.h.a.a.g;
import a.i.l;

import java.util.Comparator;

public class h
{
  private b a;
  private q b;
  private a.f.h.a.a.b c;
  private d d = null;
  public static boolean e;
  
  public h(b paramb)
  {
    this.a = paramb;
    this.b = this.a.d();
    this.c = this.a.b();
  }
  
  public void a(ab paramab)
  {
    boolean bool2 = b.i;
    int i = b.h;
    c(paramab);
    m localm = paramab.l();
    if (localm.e()) {
      this.d = localm.a();
    }
    label150:
    while (bool2)
    {
      if (((!bool2) && ((!this.a.t(this.d)) && (bool2))) || (this.a.E(this.d) >= 1))
      {
        ab localab = this.a.d(this.d);
        if (localab != null)
        {
          boolean bool1 = k.c(this.a, this.d);
          if (bool2) {
            break label150;
          }
          if (bool1)
          {
            b(localab);
            k.a(this.a, this.d);
          }
        }
      }
      localm.f();
      if (i == 0) {
        break;
      }
    }
  }
  
  public void b(ab paramab)
  {
    boolean bool = b.i;
    int i = b.h;
    do
    {
      m localm = paramab.l();
      while (i == 0)
      {
        if (!localm.e()) {
          break;
        }
        a(localm.a());
        localm.f();
      }
    } while (bool);
  }
  
  public void a(d paramd)
  {
    boolean bool = b.i;
    int i = b.h;
    d locald1 = this.a.c(paramd);
    d locald2 = this.a.g(paramd);
    d locald3 = this.a.h(paramd);
    e locale1 = paramd.e();
    e locale2 = paramd.f();
    g localg1 = this.c.a(locale1);
    g localg2 = this.c.a(locale2);
    if (!bool) {
      if (localg1 == localg2.a())
      {
        this.a.b(locale1, paramd);
        this.a.a(locale2, locald1);
        this.b.a(paramd);
        this.b.a(locald1);
        if (!bool)
        {
          if (!this.a.e(locale2)) {
            return;
          }
          a(locale2);
        }
        if (i == 0) {
          return;
        }
      }
    }
    if (localg2 == localg1.a())
    {
      this.a.b(locale2, locald1);
      this.a.a(locale1, paramd);
      this.b.a(paramd);
      this.b.a(locald1);
      if (!bool)
      {
        if (!this.a.e(locale1)) {
          return;
        }
        a(locale1);
      }
      if (!bool) {
        if (i == 0) {
          return;
        }
      }
    }
    else
    {
      this.a.a(locale2, locald1);
      this.a.a(locale1, paramd);
      this.b.a(paramd);
      this.b.a(locald1);
    }
    if (!bool) {
      if (this.a.e(locale1)) {
        a(locale1);
      }
    }
    if ((bool) || (this.a.e(locale2))) {
      a(locale2);
    }
  }
  
  private void a(e parame)
  {
    boolean bool = b.i;
    int i = b.h;
    if (parame.e() == 2)
    {
      d locald2 = this.a.a(parame).m();
      if (!bool) {
        if (this.a.a(locald2))
        {
          locald1 = this.a.c(locald2);
          locald3 = locald2;
          locald2 = this.a.h(locald1);
          locald4 = this.a.c(locald2);
          if (bool) {
            break label106;
          }
          if (i == 0) {
            break label116;
          }
        }
      }
      d locald4 = this.a.c(locald2);
      d locald1 = this.a.g(locald2);
      label106:
      d locald3 = this.a.c(locald1);
      label116:
      d locald7 = this.a.e(locald1);
      ab localab = this.a.f(locald1);
      if (!bool)
      {
        this.a.D(locald7);
        if (localab.size() == 2)
        {
          locald5 = locald7;
          locald6 = this.a.c(locald5);
          this.b.g(locald5);
          if (!bool) {
            if (locald6 != null)
            {
              this.b.g(locald6);
              if (bool) {
                break label240;
              }
              if (i == 0) {
                break label223;
              }
            }
          }
          locald6 = this.a.k(locald5);
          label223:
          if (bool) {
            break label248;
          }
          this.a.b(locald5, false);
          label240:
          if (i == 0) {
            break label480;
          }
        }
      }
      label248:
      Object localObject1 = this.a.g(locald1);
      Object localObject2 = this.a.h(locald2);
      d locald5 = this.b.a(locald1.e(), locald2.f());
      d locald6 = this.a.k(locald5);
      Object localObject3 = localab.a(locald5, this.a.j(locald1));
      this.a.a(locald5, (v)localObject3);
      localab.remove(locald1);
      localab.remove(locald2);
      if (!bool) {
        if (localObject1 != null)
        {
          if (!bool)
          {
            if (this.a.i(locald1) == localObject1) {
              this.a.c(locald5, (d)localObject1);
            }
            if (bool) {
              break label403;
            }
          }
          if (this.a.i((d)localObject1) == locald1) {
            this.a.c((d)localObject1, locald5);
          }
        }
      }
      label403:
      if ((bool) || (localObject2 != null))
      {
        if (!bool)
        {
          if (this.a.i(locald2) == localObject2) {
            this.a.c(locald5, (d)localObject2);
          }
          if (bool) {
            break label475;
          }
        }
        if (this.a.i((d)localObject2) == locald2) {
          this.a.c((d)localObject2, locald5);
        }
      }
      label475:
      this.a.b(locald5, locald7);
      label480:
      localObject1 = locald5.e();
      localObject2 = locald5.f();
      localObject3 = this.c.a((e)localObject1);
      g localg1 = this.c.a((e)localObject2);
      if (!bool) {
        if (localg1 == ((f)localObject3).a())
        {
          this.a.c((e)localObject1, locald1, locald5);
          this.a.h((e)localObject2, locald4, locald6);
          if (bool) {
            break label647;
          }
          if (i == 0) {
            break label636;
          }
        }
      }
      if (localObject3 == localg1.a())
      {
        this.a.h((e)localObject1, locald1, locald5);
        this.a.c((e)localObject2, locald4, locald6);
        if (bool) {
          break label647;
        }
        if (i == 0) {}
      }
      else
      {
        this.a.c((e)localObject1, locald1, locald5);
        this.a.c((e)localObject2, locald4, locald6);
      }
      label636:
      this.a.D(this.d);
      label647:
      g localg2 = this.c.a(parame);
      this.c.b(localg2);
      this.b.a(parame);
    }
  }
  
  private void c(ab paramab)
  {
    paramab.a(new a_());
  }
  
  class a_
    implements Comparator
  {
    a_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      d locald1 = (d)paramObject1;
      d locald2 = (d)paramObject2;
      return l.a(h.this.a.E(locald2), h.this.a.E(locald1));
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.a.b.h

 * JD-Core Version:    0.7.0.1

 */